TBasicPrimitive Class Reference
[Base Classes for plugins]

Inheritance diagram for TBasicPrimitive:

TBasicDataExchanger I3DExGeometricPrimitive TBasicUnknown IExDataExchanger IMCUnknown TMCObject IMCUnknown IMCUnknown List of all members.

Public Member Functions

 TBasicPrimitive ()
virtual ~TBasicPrimitive ()
virtual MCCOMErr MCCOMAPI QueryInterface (const MCIID &riid, void **ppvObj)
virtual uint32 MCCOMAPI AddRef ()
virtual void *MCCOMAPI GetExtensionDataBuffer ()
 You MUST implement this method if you have a pmap (the default returns NULL).
virtual MCCOMErr MCCOMAPI EnumPatches (EnumPatchesCallback callback, void *privData, boolean &closed)
virtual MCCOMErr MCCOMAPI GetNbrLOD (int16 &nbrLod)
virtual MCCOMErr MCCOMAPI GetLOD (int16 lodIndex, real &lod)
virtual MCCOMErr MCCOMAPI GetFacetMesh (uint32 lodIndex, FacetMesh **outMesh)
virtual void MCCOMAPI ChangeLocalTimeInHit (RayHitParameters &params)
virtual boolean MCCOMAPI NeedAnimatedShader ()
 Returns true if this primitive uses local time and therefore need animated shaders.
virtual boolean MCCOMAPI HasRenderingFacetMesh ()
virtual MCCOMErr MCCOMAPI GetRenderingFacetMesh (FacetMesh **outMesh)
 Returns the mesh that should be used for final rendering.
virtual void MCCOMAPI GetRenderingMesh (MeshDataStructure::TMeshList **meshList)
virtual boolean MCCOMAPI CanBeSplit ()
virtual MCCOMErr MCCOMAPI SplitPrimitive (TMCCountedPtrArray< I3DExGeometricPrimitive > &subParts, TMCArray< TTransform3D > &subPartPositions)
virtual uint32 MCCOMAPI GetUVSpaceCount ()
virtual MCCOMErr MCCOMAPI GetUVSpace (uint32 uvSpaceID, UVSpaceInfo *uvSpaceInfo)
virtual boolean MCCOMAPI CanRenameUVSpace ()
virtual MCCOMErr MCCOMAPI RenameUVSpace (uint32 uvSpaceID, const TMCString &name)
virtual MCCOMErr MCCOMAPI UV2XYZ (TVector2 *uv, uint32 uvSpaceID, TVector3 *resultPosition, boolean *inUVSpace)
virtual MCCOMErr MCCOMAPI GetUVSpaceRDS5 (uint32 uvSpaceID, UVSpaceInfoRDS5 *uvSpaceInfoRDS5)
virtual MCCOMErr MCCOMAPI AppendToRenderables (const TTransform3D &worldFromModelTfm, TRenderableAndTfmArray &renderableAndTfm)
virtual boolean MCCOMAPI AutoSwitchToModeler () const
virtual boolean MCCOMAPI IsBBoxPickable () const
virtual MCCOMErr MCCOMAPI GetWizardPath (TMCString &path)
virtual boolean MCCOMAPI CanConvertToOtherModeler ()
virtual void MCCOMAPI GetUserPresetPath (TMCDynamicString &path)
 Return the path from the preset folder to the user-defined preset folder.
virtual boolean MCCOMAPI IsExcludedFromTripleBuffer ()
virtual void MCCOMAPI GetDefaultShader (I3DShShader **shader, TMCString *name=nil)
virtual void MCCOMAPI ChangedData ()
virtual boolean MCCOMAPI IsGenerator () const
virtual I3DShObject *MCCOMAPI GetPreviewObject (I3DShTreeElement **previewTree)

Protected Member Functions

virtual real GetFidelity ()
virtual void GetMinMaxLOD (real &minLOD, real &maxLOD)

Detailed Description

Basic Primitive class. Derive from this for a default implementation of I3DExGeometricPrimitive
See also:
I3DExGeometricPrimitive


Constructor & Destructor Documentation

TBasicPrimitive::TBasicPrimitive (   ) 
 

virtual TBasicPrimitive::~TBasicPrimitive (   )  [virtual]
 


Member Function Documentation

virtual uint32 MCCOMAPI TBasicPrimitive::AddRef (   )  [inline, virtual]
 

Increments the reference count of the object

Reimplemented from TBasicDataExchanger.

virtual MCCOMErr MCCOMAPI TBasicPrimitive::AppendToRenderables (  const TTransform3D &  worldFromModelTfm,
TRenderableAndTfmArray &  renderableAndTfm
)  [virtual]
 

Appends the renderable to the renderable array. This is used to append extra renderables on top of the geometry itself.

Parameters:
worldFromModelTfm The global transform of the primitive.
renderableAndTfm The array of renderable and transforms.

Implements I3DExGeometricPrimitive.

virtual boolean MCCOMAPI TBasicPrimitive::AutoSwitchToModeler (   )  const [virtual]
 

Returns true if the primitive should be open in its modeler immediately after its insertion

Implements I3DExGeometricPrimitive.

virtual boolean MCCOMAPI TBasicPrimitive::CanBeSplit (   )  [virtual]
 

Returns true if the primitive can split itself into sub parts of the same type.

Implements I3DExGeometricPrimitive.

virtual boolean MCCOMAPI TBasicPrimitive::CanConvertToOtherModeler (   )  [inline, virtual]
 

Returns true if need an apparent button to convert to other modeler.

Implements I3DExGeometricPrimitive.

virtual boolean MCCOMAPI TBasicPrimitive::CanRenameUVSpace (   )  [inline, virtual]
 

Returns true if the primitive can rename uv spaces (ie. implements RenameUVSpace()).

Implements I3DExGeometricPrimitive.

virtual void MCCOMAPI TBasicPrimitive::ChangedData (   )  [inline, virtual]
 

Do not use. Temporary call.

Implements I3DExGeometricPrimitive.

virtual void MCCOMAPI TBasicPrimitive::ChangeLocalTimeInHit (  RayHitParameters &  params  )  [inline, virtual]
 

Let the object change the local time after a hit

Parameters:
params the parameters of the hit, only params.fHit->fTime should be changed

Implements I3DExGeometricPrimitive.

virtual MCCOMErr MCCOMAPI TBasicPrimitive::EnumPatches (  EnumPatchesCallback  callback,
void *  privData,
boolean &  closed
)  [virtual]
 

Returns the primitive as a list of bicubic patches. It is recommended to use GetFacetMesh() instead.

Parameters:
callback Callback procedure that should be called for each Patch generated by the Primitive.
privData Points to private data from the Shell. Pass this pointer to callback.
closed Returns True when the surface is closed. This helps set the backface mask correctly.

Implements I3DExGeometricPrimitive.

virtual void MCCOMAPI TBasicPrimitive::GetDefaultShader (  I3DShShader **  shader,
TMCString *  name = nil
)  [virtual]
 

Returns the default shader for this primitive. This is called each time a primitive is inserted in a scene without a shader

Parameters:
shader should return a pointer to the shader that should be used for this primitive (NULL to use the default master shader)
name if not nil can fill with the name of the default shader

Implements I3DExGeometricPrimitive.

virtual void* MCCOMAPI TBasicPrimitive::GetExtensionDataBuffer (   )  [virtual]
 

You MUST implement this method if you have a pmap (the default returns NULL).

Reimplemented from TBasicDataExchanger.

virtual MCCOMErr MCCOMAPI TBasicPrimitive::GetFacetMesh (  uint32  lodIndex,
FacetMesh **  outMesh
)  [virtual]
 

Returns the Facet Mesh for this lod index.

Parameters:
lodIndex The index of the level of detail that is asked (see GetNbrLOD())
outMesh A pointer to a pointer that should be set to point on the FacetMesh.

Implements I3DExGeometricPrimitive.

virtual real TBasicPrimitive::GetFidelity (   )  [protected, virtual]
 

virtual MCCOMErr MCCOMAPI TBasicPrimitive::GetLOD (  int16  lodIndex,
real &  lod
)  [virtual]
 

Return the floating point value of the level of detail that corresponds to the 0-based 'lodIndex'. (lodIndex=0 means highest resolution)

Parameters:
lodIndex The index of the level of detail
lod The returned lod precision.

Implements I3DExGeometricPrimitive.

virtual void TBasicPrimitive::GetMinMaxLOD (  real &  minLOD,
real &  maxLOD
)  [protected, virtual]
 

virtual MCCOMErr MCCOMAPI TBasicPrimitive::GetNbrLOD (  int16 &  nbrLod  )  [virtual]
 

Returns the number of levels of detail (lod) of the primitive. This value is used to determine the lodIndex in GetLOD().

Parameters:
nbrLod The number returned for the levels of detail for the primitive.
Note:
: Read the technical explanations in BasicPrimitive.cpp to learn everything about LOD (Level Of Details) management, and multi-resolution support.

Implements I3DExGeometricPrimitive.

virtual I3DShObject* MCCOMAPI TBasicPrimitive::GetPreviewObject (  I3DShTreeElement **  previewTree  )  [inline, virtual]
 

Return the Master object to preview if different from main one. Return NULL if it is the same,

Parameters:
previewTree a tree to set the transform of the preview object (only the transform will be used)

Implements I3DExGeometricPrimitive.

virtual MCCOMErr MCCOMAPI TBasicPrimitive::GetRenderingFacetMesh (  FacetMesh **  outMesh  )  [virtual]
 

Returns the mesh that should be used for final rendering.

Implements I3DExGeometricPrimitive.

virtual void MCCOMAPI TBasicPrimitive::GetRenderingMesh (  MeshDataStructure::TMeshList **  meshList  )  [virtual]
 

Returns a pointer to the rendering mesh associated with the primitive. Note that the mesh is not cached by the primitive so you can modify it and it is your responsability to delete it.

Returns:
NULL if the primitive does not support this (in which case you should get the facet mesh.

Implements I3DExGeometricPrimitive.

virtual void MCCOMAPI TBasicPrimitive::GetUserPresetPath (  TMCDynamicString &  path  )  [inline, virtual]
 

Return the path from the preset folder to the user-defined preset folder.

virtual MCCOMErr MCCOMAPI TBasicPrimitive::GetUVSpace (  uint32  uvSpaceID,
UVSpaceInfo *  uvSpaceInfo
)  [virtual]
 

Returns the information regarding a particular uvSpace (= shading domain).

Parameters:
uvSpaceID The ID of the uvspace (0 based index)
uvSpaceInfo A pointer to a structure where the information will be stored.

Implements I3DExGeometricPrimitive.

virtual uint32 MCCOMAPI TBasicPrimitive::GetUVSpaceCount (   )  [virtual]
 

Returns the number of UV space on the primitives.

Implements I3DExGeometricPrimitive.

virtual MCCOMErr MCCOMAPI TBasicPrimitive::GetUVSpaceRDS5 (  uint32  uvSpaceID,
UVSpaceInfoRDS5 *  uvSpaceInfoRDS5
)  [virtual]
 

Returns the information regarding a particular uvSpace (= shading domain). To be implemented only if your primitive existed in RDS 5 or earlier, so that UV spaces can be mapped properly to the new 0..1 boundaries

Parameters:
uvSpaceID The ID of the uvspace (0 based index)
uvSpaceInfoRDS5 A pointer to a structure where the information will be stored.

Implements I3DExGeometricPrimitive.

virtual MCCOMErr MCCOMAPI TBasicPrimitive::GetWizardPath (  TMCString &  path  )  [inline, virtual]
 

Returns the path to the primitive wizard file (wizard.txt) from the application folder.

Parameters:
path path to the primitive wizard file from the application folder

Implements I3DExGeometricPrimitive.

virtual boolean MCCOMAPI TBasicPrimitive::HasRenderingFacetMesh (   )  [virtual]
 

Returns true if this primitive has a mesh used only for final rendering. If it returns false, you can assume that the mesh for lod 0 and the rendering mesh are the same.

Implements I3DExGeometricPrimitive.

virtual boolean MCCOMAPI TBasicPrimitive::IsBBoxPickable (   )  const [inline, virtual]
 

Returns true if the primitive can be picked in the 3D View when clicking on its bounding box. Usually, you want to reply no, since the picking is done thru a ray-tracing hit test. However, some primitives such as volumic primitives or particles systems may want to answer yes. Default implementation in TBasicPrimitive returns false.

Implements I3DExGeometricPrimitive.

virtual boolean MCCOMAPI TBasicPrimitive::IsExcludedFromTripleBuffer (   )  [inline, virtual]
 

Return true if its instances should be excluded from the triple buffer (eg used for skinning)

Implements I3DExGeometricPrimitive.

virtual boolean MCCOMAPI TBasicPrimitive::IsGenerator (   )  const [inline, virtual]
 

Return true if the object can generate sub instances if true the component should also implements I3DExInstancePrimitive

Implements I3DExGeometricPrimitive.

virtual boolean MCCOMAPI TBasicPrimitive::NeedAnimatedShader (   )  [inline, virtual]
 

Returns true if this primitive uses local time and therefore need animated shaders.

Implements I3DExGeometricPrimitive.

virtual MCCOMErr MCCOMAPI TBasicPrimitive::QueryInterface (  const MCIID &  riid,
void **  ppvObj
)  [virtual]
 

Check if the object supports a given interface and returns a pointer to that interface if it does. Note that QueryInterface will increment the reference count of the object by one if the interface is found.

Parameters:
riid GUID of the interface
ppvObj A pointer to the pointer being returned.

Reimplemented from TBasicDataExchanger.

virtual MCCOMErr MCCOMAPI TBasicPrimitive::RenameUVSpace (  uint32  uvSpaceID,
const TMCString &  name
)  [inline, virtual]
 

Rename a particular uvSpace (= shading domain).

Parameters:
uvSpaceID The ID of the uvspace (0 based index)
name The new name of the uvspace.

Implements I3DExGeometricPrimitive.

virtual MCCOMErr MCCOMAPI TBasicPrimitive::SplitPrimitive (  TMCCountedPtrArray< I3DExGeometricPrimitive > &  subParts,
TMCArray< TTransform3D > &  subPartPositions
)  [virtual]
 

Builds a list of sub-parts of itself. 'subPartPositions' gives the relative position of each sub part in the object local coordinates. Both arrays need to be of same size.

Note: the original primitive needs to remain intact.

Parameters:
subParts An array of sub primitives.
subPartPositions For each sub primitives, its transform.

Implements I3DExGeometricPrimitive.

virtual MCCOMErr MCCOMAPI TBasicPrimitive::UV2XYZ (  TVector2 *  uv,
uint32  uvSpaceID,
TVector3 *  resultPosition,
boolean *  inUVSpace
)  [virtual]
 

Returns the position in 3D of a point given a set of UV coordinates. This is useful if you want to calculate a UV texture from a 3D shaders for instance.

Returns:
MC_S_OK if it is implemented, E_NOTIMPL if it isn't (in which case a default implementation will be used by the shell).
Parameters:
uv The uv coordinates used as input
uvSpaceID The uv space ID to which this uv coordinates corresponds
resultPosition The 3D Position that is returned.
inUVSpace Returns true if the point was found in the upSpaceID specified.

Implements I3DExGeometricPrimitive.


The documentation for this class was generated from the following file:
Generated on Wed Dec 7 14:27:43 2005 for Carrara SDK Doc by  doxygen 1.4.5